# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: TBK <alpine@jjtc.eu>
pkgname=py3-more-itertools
_pkgname=more-itertools
pkgver=8.13.0
pkgrel=0
pkgdesc="More routines for operating on iterables, beyond itertools"
url="https://github.com/more-itertools/more-itertools"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-installer"
source="https://github.com/more-itertools/more-itertools/archive/v$pkgver/more-itertools-$pkgver.tar.gz
	https://files.pythonhosted.org/packages/py3/m/more_itertools/more_itertools-$pkgver-py3-none-any.whl
	"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="py-more-itertools" # Backwards compatibility
provides="py-more-itertools=$pkgver-r$pkgrel" # Backwards compatibility

prepare() {
	default_prepare

	# use tests from GitHub tarball, but source code from wheel
	unzip -q "$srcdir"/more_itertools-$pkgver-py3-none-any.whl -d "$srcdir"/wheel
}

build() {
	# install directly from pypi tarball to avoid circular dep with py3-setuptools
	return 0
}

check() {
	PYTHONPATH="$srcdir/wheel" python3 -m unittest
}

package() {
	python3 -m installer -d "$pkgdir" \
		"$srcdir"/more_itertools-$pkgver-py3-none-any.whl
}

sha512sums="
c723d46ccd16ce26e5cd53971959ffcf617558d17a0fb584d1df2f27e5a24e39e62c0dbe42be7bd8ea9c2f60a055feb9fbb21ccd2a4439e0bb2365ce805bb44d  more-itertools-8.13.0.tar.gz
71b94d28a498dc103d6180ee5b8f75572ae204eada9cd2cbd66c1783a34db9d4579820a178e06ba29645efe4bb3d4f1a745931c65d992814712afd1358a6c06d  more_itertools-8.13.0-py3-none-any.whl
"
